package io;

import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class FlushDemo1 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("OIP11.txt");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        String str = "永不结婚";
        byte[]data = str.getBytes(StandardCharsets.UTF_8);
        bos.write(data);
        bos.flush();
        System.out.println("数据写出完毕!");
    }

}
